<?php

use Illuminate\Support\Facades\Route;

Route::group(['middleware' => 'guest:admin'], function () {

    // 登录
    Route::group(['prefix' => 'login'], function () {

        // 登录
        Route::get('/')
            ->uses('LoginController@getLogin')
            ->name('admin.login');

        Route::post('/')
            ->uses('LoginController@postLogin');

        // 短信登录
        Route::get('sms')
            ->uses('LoginController@getSmsLogin')
            ->name('admin.login.sms');

        Route::post('sms')
            ->uses('LoginController@postSmsLogin');
    });

    // 注册
    Route::get('register')
        ->uses('RegisterController@getRegister')
        ->name('admin.register');

    Route::post('register')
        ->uses('RegisterController@postRegister');

});

// 退出
Route::match(['get', 'post'], 'logout')
    ->uses('LoginController@postLogout')
    ->name('admin.logout');


